﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Mulala.Cavan.Domain.MainBoundedContext.SearchModule;
using Mulala.Cavan.Core.Persistent;
using Mulala.Cavan.Domain.MainBoundedContext.CorporationModule;

namespace Mulala.Cavan.Domain.MainBoundedContext.MulalaModule
{
    public class SpecificationFactory
    {
        public static AreaSpecification CreateAreaSpecification(AreaSearch searchParams)
        {
            AreaSpecification specification = new AreaSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static TagSpecification CreateTagSpecification(TagSearch searchParams)
        {
            TagSpecification specification = new TagSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static NannySpecification CreateNannySpecification(NannySearch searchParams)
        {
            NannySpecification specification = new NannySpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static NannyCommentSpecification CreateNannyCommentSpecification(NannyCommentSearch searchParams)
        {
            NannyCommentSpecification specification = new NannyCommentSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static NannyDiarySpecification CreateNannyDiarySpecification(NannyDiarySearch searchParams)
        {
            NannyDiarySpecification specification = new NannyDiarySpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static CorporationSpecification CreateCorporationSpecification(CorporationSearch searchParams)
        {
            CorporationSpecification specification = new CorporationSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static CorporationCommentSpecification CreateCorporationCommentSpecification(CorporationCommentSearch searchParams)
        {
            CorporationCommentSpecification specification = new CorporationCommentSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static CorporationNewSpecification CreateCorporationNewSpecification(CorporationNewSearch searchParams)
        {
            CorporationNewSpecification specification = new CorporationNewSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static ConsignSpecification CreateConsignSpecification(ConsignSearch searchParams)
        {
            ConsignSpecification specification = new ConsignSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static UserAccountSpecification CreateUserAccountSpecification(UserAccountSearch searchParams)
        {
            UserAccountSpecification specification = new UserAccountSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static AttachmentSpecification CreateAttachmentSpecification(AttachmentSearch searchParams)
        {
            AttachmentSpecification specification = new AttachmentSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static NoticeSpecification CreateNoticeSpecification(NoticeSearch searchParams)
        {
            NoticeSpecification specification = new NoticeSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static ConsignBidderSpecification CreateConsignBidderSpecification(ConsignBidderSearch searchParams)
        {
            ConsignBidderSpecification specification = new ConsignBidderSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static UserMessageSpecification CreateUserMessageSpecification(UserMessageSearch searchParams)
        {
            UserMessageSpecification specification = new UserMessageSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static NoteSpecification CreateNoteSpecification(NoteSearch searchParams)
        {
            NoteSpecification specification = new NoteSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static NoteReceiverSpecification CreateNoteReceiverSpecification(NoteReceiverSearch searchParams)
        {
            NoteReceiverSpecification specification = new NoteReceiverSpecification();
            specification.SearchParams = searchParams;

            return specification;
        }

        public static ISpecification CreateSpecification<T, TSearch>(TSearch searchParams)
        {
            if (searchParams is AreaSearch)
            {
                return SpecificationFactory.CreateAreaSpecification(searchParams as AreaSearch);
            }
            else if (searchParams is CorporationSearch)
            {
                return SpecificationFactory.CreateCorporationSpecification(searchParams as CorporationSearch);
            }
            else if (searchParams is CorporationCommentSearch)
            {
                return SpecificationFactory.CreateCorporationCommentSpecification(searchParams as CorporationCommentSearch);
            }
            else if (searchParams is CorporationNewSearch)
            {
                return SpecificationFactory.CreateCorporationNewSpecification(searchParams as CorporationNewSearch);
            }
            else if (searchParams is ConsignSearch)
            {
                return SpecificationFactory.CreateConsignSpecification(searchParams as ConsignSearch);
            }
            else if (searchParams is TagSearch)
            {
                return SpecificationFactory.CreateTagSpecification(searchParams as TagSearch);
            }
            else if (searchParams is NannySearch)
            {
                return SpecificationFactory.CreateNannySpecification(searchParams as NannySearch);
            }
            else if (searchParams is NannyCommentSearch)
            {
                return SpecificationFactory.CreateNannyCommentSpecification(searchParams as NannyCommentSearch);
            }
            else if (searchParams is NannyDiarySearch)
            {
                return SpecificationFactory.CreateNannyDiarySpecification(searchParams as NannyDiarySearch);
            }
            else if (searchParams is UserAccountSearch)
            {
                return SpecificationFactory.CreateUserAccountSpecification(searchParams as UserAccountSearch);
            }
            else if (searchParams is AttachmentSearch)
            {
                return SpecificationFactory.CreateAttachmentSpecification(searchParams as AttachmentSearch);
            }
            else if (searchParams is NoticeSearch)
            {
                return SpecificationFactory.CreateNoticeSpecification(searchParams as NoticeSearch);
            }
            else if (searchParams is ConsignBidderSearch)
            {
                return SpecificationFactory.CreateConsignBidderSpecification(searchParams as ConsignBidderSearch);
            }
            else if (searchParams is UserMessageSearch)
            {
                return SpecificationFactory.CreateUserMessageSpecification(searchParams as UserMessageSearch);
            }
            else if (searchParams is NoteSearch)
            {
                return SpecificationFactory.CreateNoteSpecification(searchParams as NoteSearch);
            }
            else if (searchParams is NoteReceiverSearch)
            {
                return SpecificationFactory.CreateNoteReceiverSpecification(searchParams as NoteReceiverSearch);
            }
            return null;
        }
    }
}
